home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
5
/
CHASSIS_
/
DRAWDEFA.C
< prev
next >
Wrap
Text File
|
1992-05-14
|
2KB
|
43 lines
/************************************************************************************/
/* DrawDefaultBorder */
/* */
/* This procedure draws a thick-line rounded rectangle in the userItem which */
/* has been defined in the same area of the window as the default (item #1) */
/* button. The userItem must be defined large enough to contain the thick-line */
/* rounded rectangle. */
/* */
/* This procedure gets invoked repeatedly by the Dialog Manager while the dialog */
/* is active. */
/* */
/* Note, parameter "itemNo" is the item number of the userItem, not of the default */
/* Button. "itemNo" isn't actually used in this procedure. */
/************************************************************************************/
#include "MyHeaders.h"
pascal void DrawDefaultBorder(DialogPtr theDialog, short itemNo)
{
GrafPtr oldPort;
PenState oldPen;
int iType;
Handle h;
Rect box;
GetPort(&oldPort); /* preserve current grafport */
SetPort(theDialog); /* point to dialog grafport */
GetPenState(&oldPen); /* preserve current pen state */
PenNormal(); /* reset the pen state */
GetDItem(theDialog, 1, &iType, &h, &box); /* get the default (#1) item's info */
PenSize(3,3); /* set thicker pen size */
InsetRect(&box, -4, -4); /* inset outside of default item */
FrameRoundRect(&box, 16, 16); /* draw the border */
SetPenState(&oldPen); /* restore the pen state */
SetPort(oldPort); /* restore the current grafport */
return;
}